﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - My ASP.NET MVC Application</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    @Styles.Render("~/Content/css")
    <link href="~/Content/themes/base/jquery.ui.all.css" rel="stylesheet" />
    @Scripts.Render("~/bundles/modernizr")

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryui")
    @Scripts.Render("~/bundles/jqueryval")
    <script src="~/Scripts/JSON.js"></script>

</head>
<body>
    <header>
        <div class="content-wrapper">
            <div class="float-left">
                <p class="site-title">@Html.ActionLink("CREATE YOUR OWN BOOK SET", "Index", "Home")</p>
            </div>
            <div class="float-right">
                <section id="login">
                    @Html.Partial("_LoginPartial")
                </section>
            </div>
        </div>
    </header>
    <div class="break10">
    </div>
    <div class="break30">
        <div class="content-wrapper">
            <nav>
                <ul id="menu">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("Book", "Index", "Book")</li>
                    <li>@Html.ActionLink("Token", "Index", "Fetch")</li>

                    <li>@Html.ActionLink("About", "About", "Home")</li>
                    <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                </ul>

            </nav>
        </div>
    </div>
    <div id="body">
        <section class="content-wrapper1 main-content clear-fix">
            <div class="fullBook">
                @Html.Partial("_ApplicationUser")
                @RenderBody()
                <table class="fullBook">
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                </table>
            </div>
        </section>
    </div>
    <div class="break1">
    </div>
    <div class="break3">
    </div>
    <footer>
        <div class="content-wrapper">
            <div class="float-left">
                <p>&copy; @DateTime.Now.Year - My Book Application</p>
            </div>
        </div>
    </footer>

    @RenderSection("scripts", required: false)
    <style>
        .json {
            padding: 10px;
        }

        .number {
            color: #e83;
        }

        .key {
            color: #444;
            font-weight: bolder;
        }

        .string {
            color: #999;
        }

        .bloean {
            color: #d83;
        }

        .null {
            color: #f00;
        }
    </style>

    <script type="text/javascript">

        function syntaxHighlight(json) {
            json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
            return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
                var cls = 'number';
                if (/^"/.test(match)) {
                    if (/:$/.test(match)) {
                        cls = 'key';
                    } else {
                        cls = 'string';
                    }
                } else if (/true|false/.test(match)) {
                    cls = 'boolean';
                } else if (/null/.test(match)) {
                    cls = 'null';
                }
                return '<span class="' + cls + '">' + match + '</span>';
            });
        }
        $(function () {
            $(".json").each(function () {
                var imp = $(this).text();
                if (imp.length > 10) {
                    var obj = JSON.parse(imp);
                    var str = JSON.stringify(obj, undefined, 4);
                    $(this).html("<pre>" + syntaxHighlight(str) + "</pre>");
                }
            });
        });
    </script>

</body>
</html>
